<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <title>DSpace Documentation : JSPUI Configuration and Customization</title>
	    <link rel="stylesheet" href="styles/site.css" type="text/css" />
        <META http-equiv="Content-Type" content="text/html; charset=UTF-8">	    
    </head>

    <body>
	    <table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#ffffff">
		    <tr>
			    <td valign="top" class="pagebody">
				    <div class="pageheader">
					    <span class="pagetitle">
                            DSpace Documentation : JSPUI Configuration and Customization
                                                    </span>
				    </div>
				    <div class="pagesubheading">
					    This page last changed on Dec 14, 2010 by <font color="#0050B2">tdonohue</font>.
				    </div>

				    <h1><a name="JSPUIConfigurationandCustomization-DSpaceSystemDocumentation%3AJPSUIConfigurationandCustomization"></a>DSpace System Documentation: JPSUI Configuration and Customization</h1>

<p>The DSpace digital repository supports two user interfaces: one based on JavaServer Pages (JSP) technologies and one based upon the Apache Cocoon framework (XMLUI). This chapter describes those parameters which are specific to the JPSUI interface.</p>

<style type='text/css'>/*<![CDATA[*/
div.rbtoc1292368302632 {margin-left: 0px;padding: 0px;}
div.rbtoc1292368302632 ul {list-style: none;margin-left: 0px;}
div.rbtoc1292368302632 li {margin-left: 0px;padding-left: 0px;}

/*]]>*/</style><div class='rbtoc1292368302632'>
<ul>
    <li><span class='TOCOutline'>1</span> <a href='#JSPUIConfigurationandCustomization-Configuration'>Configuration</a></li>
    <li><span class='TOCOutline'>2</span> <a href='#JSPUIConfigurationandCustomization-CustomizingtheJSPpages'>Customizing the JSP pages</a></li>
</ul></div>

<h2><a name="JSPUIConfigurationandCustomization-Configuration"></a>Configuration</h2>

<p>The user will need to refer to the extensive <a href="Configuration.html" title="Configuration">WebUI/JSPUI configurations</a> that are contained in JSP Web Interface Settings.</p>


<h2><a name="JSPUIConfigurationandCustomization-CustomizingtheJSPpages"></a>Customizing the JSP pages</h2>

<p>The JSPUI interface is implemented using Java Servlets which handle the business logic, and JavaServer Pages (JSPs) which produce the HTML pages sent to an end-user. Since the JSPs are much closer to HTML than Java code, altering the look and feel of DSpace is relatively easy.</p>

<p>To make it even easier, DSpace allows you to 'override' the JSPs included in the source distribution with modified versions, that are stored in a separate place, so when it comes to updating your site with a new DSpace release, your modified versions will not be overwritten. It should be possible to dramatically change the look of DSpace to suit your organization by just changing the CSS style file and the site 'skin' or 'layout' JSPs in <em>jsp/layout</em>; if possible, it is recommended you limit local customizations to these files to make future upgrades easier.</p>

<p>You can also easily edit the text that appears on each JSP page by editing the <em>Messages.properties</em> file. However, note that unless you change the entry in all of the different language message files, users of other languages will still see the default text for their language. See Internationalization in Application Layer.</p>

<p>Note that the data (attributes) passed from an underlying Servlet to the JSP may change between versions, so you may have to modify your customized JSP to deal with the new data.</p>

<p>Thus, if possible, it is recommended you limit your changes to the 'layout' JSPs and the stylesheet.</p>

<p>The JSPs are available in one of two places:</p>

<ul>
	<li><em>[dspace-source]/dspace-jspui/dspace-jspui-webapp/src/main/webapp/</em> &#45; Only exists if you downloaded the full Source Release of DSpace</li>
	<li><em>[dspace-source]/dspace/target/dspace-[version].dir/webapps/dspace-jspui-webapp/</em> &#45; The location where they are copied after first building DSpace.</li>
</ul>


<p>If you wish to modify a particular JSP, place your edited version in the <b><em>[dspace-source]/dspace/modules/jspui/src/main/webapp/</em></b> directory (<em>this is the replacement for the pre-1.5 /jsp/local directory</em>), with the same path as the original. If they exist, these will be used in preference to the default JSPs. For example:</p>
<div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<td class='confluenceTd'> <b>DSpace default</b> </td>
<td class='confluenceTd'> <b>Locally-modified version</b> </td>
</tr>
<tr>
<td class='confluenceTd'> <em>[jsp.dir]/community-list.jsp</em> </td>
<td class='confluenceTd'> <em>[jsp.custom-dir]/dspace/modules/jspui/src/main/webapp/community-list.jsp</em> </td>
</tr>
<tr>
<td class='confluenceTd'> <em>[jsp.dir]/mydspace/main.jsp</em> </td>
<td class='confluenceTd'> <em>[jsp.custom-dir]/dspace/modules/jspui/src/main/webapp/mydspace/main.jsp</em> </td>
</tr>
</tbody></table>
</div>


<p>Heavy use is made of a style sheet, <em>styles.css</em>. If you make edits, copy the local version to <em>[jsp.custom-dir]/dspace/modules/jspui/src/main/webapp/styles.css</em>, and it will be used automatically in preference to the default, as described above.</p>

<p>Fonts and colors can be easily changed using the stylesheet. The stylesheet is a JSP so that the user's browser version can be detected and the stylesheet tweaked accordingly.</p>

<p>The 'layout' of each page, that is, the top and bottom banners and the navigation bar, are determined by the JSPs <em>/layout/header&#45;&#42;.jsp</em> and <em>/layout/footer&#45;&#42;.jsp</em>. You can provide modified versions of these (in <em>[jsp.custom-dir]/dspace/modules/jspui/src/main/webapp/layout</em>), or define more styles and apply them to pages by using the "style" attribute of the <em>dspace:layout</em> tag.</p>

<ol>
	<li>Rebuild the DSpace installation package by running the following command from your <em>[dspace-source]/dspace/</em> directory:
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">mvn <span class="code-keyword">package</span></pre>
</div></div></li>
	<li>Update all DSpace webapps to <em>[dspace]/webapps</em> by running the following command from your <em>[dspace-source]/dspace/target/dspace-[version]-build.dir</em> directory:
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">ant -Dconfig=[dspace]/config/dspace.cfg update </pre>
</div></div></li>
	<li>Deploy the the new webapps: 
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">cp -R /[dspace]/webapps/* /[tomcat]/webapps</pre>
</div></div></li>
	<li>Restart Tomcat<br/>
When you restart the web server you should see your customized JSPs.</li>
</ol>


				    
                    			    </td>
		    </tr>
	    </table>
	    <table border="0" cellpadding="0" cellspacing="0" width="100%">
			<tr>
				<td height="12" background="https://wiki.duraspace.org/images/border/border_bottom.gif"><img src="images/border/spacer.gif" width="1" height="1" border="0"/></td>
			</tr>
		    <tr>
			    <td align="center"><font color="grey">Document generated by Confluence on Mar 25, 2011 19:21</font></td>
		    </tr>
	    </table>
    </body>
</html>